Since tilt of position and deformation in moving typically occur for identification means for valuable documents, bills and papers during the process of placing them or high-speed movement, an image generated is often a tilted or deformed image. When a collected image is identified, firstly, an edge detection and a tilt correction are often performed on the collected image, and the content of the image after the tilt correction is further identified. Therefore, the edge detection and the tilt correction are important subjects in designing an identification system for valuable documents, bills or papers.
In the process of edge detection and tilt correction, an image of valuable documents, bills or papers has the following characteristics.
1. The shape is quadrangle, but four edges may often be fragmentary, and it is the edges with no fragmentary defects of the valuable documents, the bills or the papers that are required to be obtained.
2. The identification means has high demands on identification time and storage space. For example, a common Deposit and withdrawal machine processes a valuable medium at a very fast speed. Many identification items, for example, valuable document type identification, valuable document prefix number identification, valuable document authenticity identification and valuable document sorting identification or the like, are contained in the processing of each valuable medium; therefore, the time period for the edge detection and the tilt correction has to be short. Moreover, since more valuable media are processed in a hardware platform such as an embedded platform, demanding requirements are also imposed on the storage space.
3. The generated image of the valuable document is deformed due to factors such as inconsistent friction coefficients in a moving process of the identification apparatus; or the generated image of the papers has trapezoid deformation due to an angle problem in a process of scanning the papers.
A common edge detection algorithm is the Hough Transform. The Hough Transform is to map the rectangular coordinate system to the polar coordinate system, for example, a straight line is represented as y=kx+b in the rectangular coordinate system, and is represented as r=x cos(θ)+y sin(θ) in the polar coordinate system, and any straight line in the rectangular coordinate system corresponds to a point in the polar coordinate system. When the edge detection is performed using Hough Transform, for the edge points in the image, corresponding points (r, θ) in the polar coordinate transform domain are calculated, the corresponding points in the transform domain are accumulated, and the maximally distributed points are obtained. Further, points on a straight line of an edge to be detected are further obtained, and points that are not on the edge are eliminated. Since one cosine calculation and one sine calculation are required to be performed on each point in the process of mapping, the calculation amount is large, and the calculation time is long since the calculation is floating-point calculation.
Another common edge detection algorithm is the Canny edge detection. The Canny operator is an edge detection operator based on optimization algorithm, thereby having a good signal-noise ratio and good detection accuracy. Firstly, de-noising is performed on the image by using Gaussian filtering. Then, an amplitude value and a direction of the gradient are calculated by finite difference of first-order partial derivative. Next, a non-maximum suppression is applied on the amplitude value of the gradient. Finally, the edge is detected and joined by a double-threshold algorithm. The calculation amount is large, and the calculation time is long.
Therefore, there is a need for a method that can perform edge detection and tilt correction on a fragmentary or deformed image of valuable documents, bills or papers quickly.